<?php
	include "include/common.inc.php";

	$user = getLoginUser();
	
	$start=isset($_GET["start"])?(int)$_GET["start"]:0;
	$order=isset($_GET["order"])?$_GET["order"]:"`id` DESC";

	function showPost($post){
		$group = Group::getGroup($post->getValue("groupId"));
		$author = User::getUser($post->getValue("authorId"));
		echo "<tr>";
		echo "<td><a href=\"post.php?postId=".$post->getValue("id")."\">".$post->getValue("title")."</a></td>";
		echo "<th><a href=\"group.php?groupId=".$post->getValue("groupId")."\">".$group->getValue("name")."</a></th>";
		echo "<td>By <a href=\"user.php?userId=".$post->getValue("authorId")."\">".$author->getValue("userName")."</a><br>".$post->getValue("timestamp")."</td>";
		echo "</tr>";
	}

?>

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Main Page</title>

    <!-- Bootstrap -->
    <link href="http://getbootstrap.com/dist/css/bootstrap.min.css" rel="stylesheet">
    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
      <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
      <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
  </head>
  <body>
  
  <nav class="navbar navbar-default " role="navigation">
  <div class="container-fluid">
    <!-- Brand and toggle get grouped for better mobile display -->
    <div class="navbar-header">
      <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
      <a class="navbar-brand" href="./main_page1.html">NUS Blind Dating Site</a>
    </div>

    <!-- Collect the nav links, forms, and other content for toggling -->
    <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
      <ul class="nav navbar-nav">
        <li><a href="./main_page1.html">Home</a></li>
        <li><a href="#">About</a></li>
        <li class="dropdown">
          <a href="#" class="dropdown-toggle" data-toggle="dropdown">Groups<b class="caret"></b></a>
          <ul class="dropdown-menu">
            <li><a href="#">Top 10 popular</a></li>
            <li><a href="#">Girls favourate</a></li>
            <li><a href="#">Guys favourate</a></li>
            <li class="divider"></li>
            <li><a href="#">Seperate link</a></li>
          </ul>
        </li>
	
		
      
      </ul>
      <form class="navbar-form navbar-right" role="search">
        <div class="form-group">
          <input type="text" class="form-control" placeholder="Search">
        </div>
        <button type="submit" class="btn btn-default">Submit</button>
      </form>
      <ul class="nav navbar-nav navbar-right">
        <li><a href="Register.htm">Register</a></li>
        <li><a href="Login.htm">Login</a></li>
      </ul>
    </div><!-- /.navbar-collapse -->
  </div><!-- /.container-fluid -->
</nav>
	
	

<!--right side is a easy registration-->
<div style="float:right; width:25%; background:url(pink.jpg)">
<style>
table, th, td
{
border:none;
padding:9px;
}
table
{
background-image:url(pink.jpg);
}
</style>
<form name="register",class="form-signin" role="form">
    <table>
	<tr>
        <td><label>UserName</label></td>
        <td><input type="text" class="form-control" placeholder="UserName" required="" autofocus=""></td>
      </tr>
	  <tr>
        <td><label>Gender</label></td>
        <td>
		<select name="Gender" class="form-control" required="" autofocus="">
		<option value="Male"> Male</option>
		<option value="Male"> Female</option>
		</select>
		</td>
      </tr>
      <tr>
        <td><label>Email</label></td>
        <td><input type="email" class="form-control" placeholder="Email address" required="" autofocus=""></td>
      </tr>
	  
	  <tr>
        <td><label>Nationality</label></td>
        <td><input type="text" class="form-control" placeholder="Nationality" required="" autofocus=""></td>
      </tr>
	  
      <tr>
	    <td><label>Password</label></td>
        <td><input type="password" class="form-control" placeholder="Password" required=""></td>
      </tr>
	  <tr>
	    <td><label>Confirmed Password</label></td>
        <td><input type="password" class="form-control" placeholder="Confirmed Password" required=""></td>
      </tr>

	  <tr>
      <td width= "50%" align= "right"> <button class="btn btn-lg btn-primary btn-block" type="submit" name="Register">Register</button></td>
      <td width ="50%" align="left"> <button class="btn btn-lg btn-primary btn-block" type="submit" name="Reset">Reset</button></td>
	  <tr>
    </table>
  </form>
</div>

<!-- Group the jumbo and successive pictures of users-->
	<div style="float:left; width:72%;">
 <div class="jumbotron">
  <h1>Welcome to NUS Blind Dating Site</h1>
  <p>This is a professional site for guys and girls to find their perfect dates.</p>
  <p><a class="btn btn-primary btn-lg" role="button">Learn more</a></p>
</div>

<!--following are pictures for girls and guys-->
	<div class="row">
<div class="col-sm-6 col-md-3">
    <div class="thumbnail">
      <img src="images/Lakus.jpg" alt="Lakus">
      <div class="caption">
        <h3>Name</h3>
        <p>Description</p>
        <p><a href="#" class="btn btn-primary" role="button">Post</a></p>
      </div>
    </div>
  </div>
  
  <div class="col-sm-6 col-md-3">
    <div class="thumbnail">
      <img src="images/Lakus.jpg" alt="Lakus">
      <div class="caption">
        <h3>Name</h3>
        <p>Description</p>
        <p><a href="#" class="btn btn-primary" role="button">Post</a></p>
      </div>
    </div>
  </div>
  
  <div class="col-sm-6 col-md-3">
    <div class="thumbnail">
      <img src="images/Lakus.jpg" alt="Lakus">
      <div class="caption">
        <h3>Name</h3>
        <p>Description</p>
        <p><a href="#" class="btn btn-primary" role="button">Post</a></p>
      </div>
    </div>
  </div>
  
  <div class="col-sm-6 col-md-3">
    <div class="thumbnail">
      <img src="images/Lakus.jpg" alt="Lakus">
      <div class="caption">
        <h3>Name</h3>
        <p>Description</p>
        <p><a href="#" class="btn btn-primary" role="button">Post</a></p>
      </div>
    </div>
  </div>
  
</div>
<!-- a new row-->
<div class="row">
  <div class="col-xs-6 col-md-3">
    <div class="thumbnail">
      <img src="images/kagalin.jpg" alt="Kagalin">
      <div class="caption">
        <h3>Name</h3>
        <p>Description</p>
        <p><a href="#" class="btn btn-primary" role="button">Post</a></p>
      </div>
    </div>
  </div>
  
   <div class="col-xs-6 col-md-3">
    <div class="thumbnail">
      <img src="images/kagalin.jpg" alt="kagalin">
      <div class="caption">
        <h3>Name</h3>
        <p>Description</p>
        <p><a href="#" class="btn btn-primary" role="button">Post</a></p>
      </div>
    </div>
  </div>
  
   <div class="col-xs-6 col-md-3">
    <div class="thumbnail">
      <img src="images/kagalin.jpg" alt="kagalin">
      <div class="caption">
        <h3>Name</h3>
        <p>Description</p>
        <p><a href="#" class="btn btn-primary" role="button">Post</a></p>
      </div>
    </div>
  </div>
  
   <div class="col-xs-6 col-md-3">
    <div class="thumbnail">
      <img src="images/kagalin.jpg" alt="kagalin">
      <div class="caption">
        <h3>Name</h3>
        <p>Description</p>
        <p><a href="#" class="btn btn-primary" role="button">Post</a></p>
      </div>
    </div>
  </div>
</div>

</div>	


    <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
    <!-- Include all compiled plugins (below), or include individual files as needed -->
    <script src="js/bootstrap.min.js"></script>
  </body>
</html>
